from common.base import Base,get_driver
from selenium.webdriver.common.by import By
from page.mylogin_page import MyLogin
from page.centrol_page import Centrol


class General(Base):
    # 商品名称
    def goods_name(self,content='四大皆空平板电脑'):
        self.send_keys((By.NAME, 'goods_name'), content)
    # 字体样式-斜体
    def goods_name_style(self):
        self.click((By.XPATH,'//select[@name="goods_name_style"]/option[3]'))
    # 商品分类-平板电脑
    def cat_id(self):
        self.click((By.XPATH, '//select[@name="cat_id"]/option[4]'))
    # 商品品牌-夏新
    def brand_id(self):
        self.click((By.XPATH, '//select[@name = "brand_id"]/option[3]'))
    # 供应商-北京
    def suppliers(self):
        self.click((By.XPATH, '//select[@name = "suppliers_id"]/option[2]'))
    # 市场价格
    def shop_price(self, price=4999):
        rmb=self.driver.find_element_by_name('shop_price')
        rmb.clear()
        self.send_keys((By.NAME, 'shop_price'),price)
    # 优惠数量和优惠价格
    def volume(self,num=1000,price=4000):
        self.send_keys((By.NAME, 'volume_number[]'),num)
        self.send_keys((By.NAME, 'volume_price[]'),price)
    # 确认按钮
    def confirm(self):
        self.click((By.XPATH,'//div[@class="button-div"]/input[2]'))
